﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
   public class Ass_学霸之路_DAL
    {
       /// <summary>
       /// 显示学霸之路的信息
       /// </summary>
       /// <returns></returns>
       public List<Ass_学霸之路_> ShowAss()
       {
           using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=JingRui;Integrated Security=True"))
           {
               string sql = "select * from [Ass(学霸之路)]";
               SqlCommand com = new SqlCommand(sql, con);
               SqlDataAdapter sd = new SqlDataAdapter(com);
               DataTable dt = new DataTable();
               sd.Fill(dt);
               List<Ass_学霸之路_> list = new List<Ass_学霸之路_>();
               foreach (DataRow item in dt.Rows)
               {
                   Ass_学霸之路_  a = new Ass_学霸之路_();
                   a.Assid = Convert.ToInt32(item["Assid"]);
                   a.Asstiltletiltle = item["Asstiltletiltle"].ToString();
                   a.Assname = item["Assname"].ToString();
                   a.Asscreate = item["Asscreate"].ToString();
                   a.AssjingliOne = item["AssjingliOne"].ToString();
                   a.Assimg = item["Assimg"].ToString();
                   a.AssjingliTwo = item["AssjingliTwo"].ToString();
                   list.Add(a);
               }
               return list;

           }
       }


    }
}
